#include <iostream>
#include <cstring>
#include <algorithm>
#include <iomanip>
#include <set>
#include <vector>
#include <cstdio>
#include <cmath>
#define LL long long
#define nextLine() {int c = 0; while ((c = getchar()) != EOF && c != 10);}
#define sqr(a) ((a) * (a))
#define fill(a, c) memset(a, c, sizeof a)
#define ldb long double
#define sgn(a) ((a) > eps ? 1 : -1)
const ldb eps = 1e-9;
const ldb pi = fabs(atan2(0.0, -1.0));
const int INF = 1 << 28;
const LL LINF = 1ll << 50;
const ldb LDINF = 1e70;
const ldb cos3 = cos(pi / 3);
const ldb sin3 = sin(pi / 3);
using namespace std;
#define f first
#define s second
#define j1 jj1
#define j0 jj0

const int di[] = {0, 0, 1, -1};
const int dj[] = {-1, 1, 0, 0};
int a[110][110];
int i1, j1, i0, j0;
int n, m, k;


class My
{
 	public:
 		pair <int, int> p;
 		pair <char, char> c1;
 		pair <char, char> c2;
 		My(){}
 		My(int x, int y, char a, char b, char c, char d)
 		{
 			p.f = x;
 			p.s = y;
 			char e[4] = {a, b, c, d};
 			sort(e, e + 4);
 			reverse(e, e + 4);
 			c1.first = e[0];
 			c1.second = e[1];
 			c2.first = e[2];
 			c2.second = e[3];
 		}
};

inline bool operator < (const My &m1, const My &m2)
{
	return m1.p < m2.p || 
	(m1.p == m2.p && (m1.c1 < m2.c1 ||
	(m1.c1 == m2.c1 && m1.c2 < m2.c2)));
}

ostream &operator << (ostream &out, const My &m1)
{
	out << m1.p.f << " " << m1.p.s << " " << (int)m1.c1.f << " " << (int)m1.c1.s
	<< " " << (int)m1.c2.f << " " << (int)m1.c2.s;
	return out;
}

set <My> was;

void Load()
{
	cin >> n >> m >> k;
	int i, j;
	nextLine();
	for (i = 0; i < n; i++)
	{
		for (j = 0; j < m; j++)
		{
			a[i][j] = getchar();
			if (a[i][j] == 'S')
			{
				i0 = i;
				j0 = j;
			}
			if (a[i][j] == 'T')
			{
				i1 = i;
				j1 = j;
			}
		}
		nextLine();
	}
}
#define MD(a) (a % SIZE)

const int SIZE = 1000013;

My q[SIZE];
int col[4];

bool cmp(int a, int b)
{
	return col[a] < col[b];
}

bool can(int x, int y, My & ver)
{
	if (x < 0 || x >= n || y < 0 || y >= m) return false;
	if (a[x][y] == 'S') return false;
	if (a[x][y] == 'T') return true;
	int ch[4] = {ver.c1.f, ver.c1.s, ver.c2.f, ver.c2.s};
	int i;
	for (i = 0; i < k; i++)
	{
		if (a[x][y] - 'a' == ch[i] || ch[i] == -1)
			break;
	}
	return i < k;
}

My Make(My ver, int x, int y)
{
	int ch[4] = {ver.c1.f, ver.c1.s, ver.c2.f, ver.c2.s};
	int i;
	for (i = 0; i < k; i++)
	{
		if (a[x][y] - 'a' == ch[i] || ch[i] == -1)
			break;
	}
	if (ch[i] == -1)
	{
		ch[i] = a[x][y] - 'a';
	}
	sort(ch, ch + 4);
	reverse(ch, ch + 4);
	ver.p.f = x;
	ver.p.s = y;
	ver.c1.f = ch[0];
	ver.c1.s = ch[1];
	ver.c2.f = ch[2];
	ver.c2.s = ch[3];
	return ver;
}

//int p[SIZE];
string ans[SIZE];
int per[4];


void Solve()
{
	My ver, to;
	int head = 0, vx, vy;
	int tail = 0;
	q[0] = My(i0, j0, -1, -1, -1, -1);
	ans[0] = "";
	was.insert(q[0]);
	while (head <= tail)
	{
		ver = q[head];
		vx = ver.p.f;
		vy = ver.p.s;
		if (ans[head].size() > n * m) continue;
	//	cerr << ans[head].size() << "\n";
	//	cerr << ver << "\n";
	//	cerr << "asdasd";
	//	cerr << vx << " " << vy << "\n";
		if (vx == i1 && vy == j1)
		{
			ans[MD(head)].erase(ans[MD(head)].begin() + (int)ans[MD(head)].size() - 1, ans[MD(head)].end());
			cout << ans[MD(head)];
			return;
		}
	//	cerr << "ok";
		for (int l = 0; l < 4; l++)
		{
			col[l] = 132213;
			per[l] = l;
			if (vx + di[l] >= 0 && vx + di[l] < n 
			&& vy + dj[l] >= 0 && vy + dj[l] < m)
			{
				col[l] = a[vx + di[l]][vy + dj[l]];
				if (col[l] == 'S') col[l] = 123618;
				else if (col[l] == 'T') col[l] = -1;
			//	cerr << (int)col[l] << "\n"; 
			}
			
		}
		sort(per, per + 4, cmp);
		for (int l = 0; l < 4; l++)
		{
			if (col[per[l]] > 256) break;
			if (can(vx + di[per[l]], vy + dj[per[l]], ver))
			{
				to = Make(ver, vx + di[per[l]], vy + dj[per[l]]);
			//	cerr << to << "\n";
				if (was.find(to) == was.end())
				{
					was.insert(to);
					++tail;
					q[MD(tail)] = to;
					ans[MD(tail)] = ans[MD(head)] + (char)a[vx + di[per[l]]][vy + dj[per[l]]];
//					p[MD(tail)] = MD(head);
				}
			}
		}
		head++;

	}
	cout << "-1";
}

#define file "c"

int main()
{
	#ifndef ONLINE_JUDGE
	freopen(file".in", "rt", stdin);
	freopen(file".out", "wt", stdout);
	#endif
	Load();
	Solve();
	return 0;
}